/*
	FileName : wifi.h
	Description : 
		wifi module header file.
		
	Created on 2018.11.6 by ZZP.
	
	Revision History:
	
*/


#ifndef __WIFI_H__
#define __WIFI_H__

#include "stdint.h"

#ifdef __cplusplus
extern "C" {
#endif

//////////////////////////////////////////////////////////////////////////////////////
///	MACROS 
//////////////////////////////////////////////////////////////////////////////////////
/** Security mode */
#define USE_WEP					 (1) /*< Set to (1) to use WEP, and (0) to use OPEN */

/** AP mode Settings */
#define MAIN_WLAN_SSID           "LON_AP" /* < SSID */

#if USE_WEP
#define MAIN_WLAN_AUTH           M2M_WIFI_SEC_WEP /* < Security manner */
#define MAIN_WLAN_WEP_KEY        "1234567890" /* < Security Key in WEP Mode */
///zzp:index changed from 0 to 1
#define MAIN_WLAN_WEP_KEY_INDEX  (1)/*(0)*/
#else
#define MAIN_WLAN_AUTH           M2M_WIFI_SEC_OPEN /* < Security manner */
#endif
#define MAIN_WLAN_CHANNEL        (6) /* (6)< Channel number */
	
/** Wi-Fi Settings */
#define MAIN_WLAN_PSK                     "12345678" /**< Password for Destination SSID */
#define MAIN_WIFI_M2M_PRODUCT_NAME        "LON_JCXH"
#define MAIN_WIFI_M2M_SERVER_IP           0xFFFFFFFF /* 255.255.255.255 */
#define MAIN_WIFI_M2M_SERVER_PORT         (3000)
#define MAIN_WIFI_M2M_REPORT_INTERVAL     (1000)

#define MAIN_WIFI_M2M_BUFFER_SIZE          1460	

//////////////////////////////////////////////////////////////////////////////////////
///	Global variables
//////////////////////////////////////////////////////////////////////////////////////
/** Receive buffer definition. */
extern uint8_t gau8SocketTestBuffer[MAIN_WIFI_M2M_BUFFER_SIZE];

//////////////////////////////////////////////////////////////////////////////////////
///	Global function ptototypes
//////////////////////////////////////////////////////////////////////////////////////
extern void WIFI_work(void);
extern int8_t WIFI_Init(void);

extern int16_t WIFI_SendToClient(uint8_t *TxBuf, uint16_t BufLen);

#ifdef __cplusplus
}
#endif

#endif /* WIFI_H */


